package com.sl.au.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.sl.au.entity.TbOPProductPlanView;

@Transactional(readOnly = true)
public interface ProductPlanRepository extends JpaRepository<TbOPProductPlanView, String>{
	@Query("select n from TbOPProductPlanView n where n.cProductPlanNumber like '%'+?1+'%'")
	Page<TbOPProductPlanView> getPage(String key,Pageable pageable);
	@Query("select count(*) from TbOPProductPlanView n where n.cProductPlanNumber like '%'+?1+'%'")
	long getCount(String key);
	
	@Query("select n from TbOPProductPlanView n")
	Page<TbOPProductPlanView> getPage(Pageable pageable);
	@Query("select count(*) from TbOPProductPlanView n")
	long getCount();
}
